<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/style.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/indext1.css" rel="stylesheet" type="text/css" />  
        <link href="./resources/css/seller.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/lease.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="./resources/css/MyScript.js"/>
        <ui:insert name="Title"></ui:insert>
    </h:head>

    <h:body>
        <div id="main-wrapper">
                <p:imageSwitch effect="fade" style="height: 180px; position: relative;  margin: 0px 0px 1px 0px;    height: 180px;    border-radius: 5px;    -moz-border-radius: 5px;    -khtml-border-radius: 5px; -webkit-border-radius: 5px;">  
                    <ui:repeat value="#{masterpage.images}" var="image">  
                        <p:graphicImage value="/images/#{image}" />  
                    </ui:repeat>  
                </p:imageSwitch>
            <div id="wrapper">
                <ul id="topnav">
                    <li id="topfix"><a href="index.xhtml">Home</a></li>
                    <li><a href="Seller.xhtml">Seller</a>
                    </li>
                    <li><a href="Lease.xhtml">Leaser</a>
                    </li>
                    <li><a href="#">Contact</a></li>
                    <li><a href="#">FAQs</a></li>
                    <li><a href="Search.xhtml">Search</a></li>
                    <li><a href="choice.xhtml">Create Message</a></li>
                </ul>
            </div>
            <div>
                <div id="right"> 
                    <h:form prependId="false">  

                        <p:panel id="panel" rendered="#{loginform.user == null}" header="Login Form"> 
                            <h:panelGrid>  
                                <h:outputLabel for="name" value="Username:" />  
                                <p:inputText style="width: 150px" id="name" value="#{loginform.account}">  
                                </p:inputText>  

                                <h:outputLabel for="pass" value="Password:" />  
                                <p:password style="width: 150px" id="pass" value="#{loginform.password}">  
                                </p:password>  
                            </h:panelGrid>  
                            <br/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <p:commandButton id="btnlogin" value="Login" update="panel, panel2" actionListener="#{loginform.checkLogin}"/>  
                        </p:panel>
                            
                        <p:panel id="panel2" rendered="#{loginform.user != null}" header="Welcome">  
                            <h:panelGrid>  
                                <h:outputLabel for="name" value="Username:" />  
                                <a href="Mymessages.xhtml">
                                    My Message
                                </a>
                                <br/>
                                <a href="Mysavemessages.xhtml">
                                    My Save Message
                                </a>

                                <h:outputLabel for="pass" value="Password:" />   
                            </h:panelGrid>  
                            <br/>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <p:commandButton id="btnlogout" value="Logout" update="panel, panel2" actionListener="#{loginform.logout}"/>  
                        </p:panel>   
                    </h:form> 
                </div>
                <div id="content" class="content">
                    <ui:insert name="content">Content</ui:insert>
                </div>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
    </h:body>
</html>
